<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>最大宽度</title>
  <style>
    div.ex1 {
      width: 500px;
      margin: auto;
      border: 3px solid #73AD21;
    }

    div.ex2 {
      max-width: 500px;
      margin: auto;
      border: 3px solid #73AD21;
    }
  </style>
</head>
<body>
<div class="ex1">宽度为500像素</div><br/>
<div class="ex2">最大宽度为500像素</div>
</body>
</html>